<template>
  <div class="goods">
    <h3>商品名称：{{ pname }}</h3>
    <p>商品单价：{{ price }}</p>
    <p>商品介绍：{{ info }}</p>
    <button @click="$emit('kanyidao',id)">砍一刀</button>
  </div>
</template>

<script>
export default {
  props: {
    id: {
      required: true,
      type: Number
    },
    pname: {
      default: '方便面'
    },
    price: Number,
    info: {
      default: '非常好吃，好点甜'
    }
  }
}
</script>

<style>
.goods {
  padding: 10px;
  margin: 8px;
  border: solid 3px black;
  min-height: 50px;
}
</style>